/*
 * @Descripttion: 运营管理接口
 * @version: 电子名片2.0
 * @Author: 冯健
 * @Date: 2020-12-09 09:50:17
 * @LastEditors: 冯健
 * @LastEditTime: 2020-12-11 10:10:35
 */

import request from '@/utils/request'

// =======================城市管理=======================

// 城市管理 - 列表
export function cityList(params) {
  return request({
    url: '/sys/platform/operation/area/detail',
    method: 'get',
    params: params
  })
}

// 城市管理 - 热门设置
export function cityHot(data) {
  return request({
    url: '/sys/platform/operation/area/detail/hot',
    method: 'put',
    data: data
  })
}

// 城市管理 - 详情
export function cityDetail(id) {
  return request({
    url: `/sys/platform/operation/area/detail/${id}`,
    method: 'get',
    params: {}
  })
}

// 城市管理 - 新增和编辑
export function cityEdit(data, config) {
  return request({
    url: '/sys/platform/operation/area/detail',
    method: 'post',
    data: data,
    ...config
  })
}

// =======================幻灯片管理=======================

// 幻灯片管理 - 列表
export function operationSlide(params) {
  return request({
    url: '/sys/platform/operation/slide',
    method: 'get',
    params: params
  })
}

// 幻灯片管理 - 上架管理
export function slideFrame(data) {
  return request({
    url: '/sys/platform/operation/slide/frame',
    method: 'post',
    data: data
  })
}

// 幻灯片管理 - 详情
export function slideDetail(slideId) {
  return request({
    url: `/sys/platform/operation/slide/detail/${slideId}`,
    method: 'get',
    params: {}
  })
}

// 幻灯片管理 - 详情
export function slideEdit(data, config) {
  return request({
    url: '/sys/platform/operation/slide',
    method: 'post',
    data: data,
    ...config
  })
}

// =======================话题管理=======================

// 话题 - 列表
export function topicList(params) {
  return request({
    url: '/circle/platform/operation/topic',
    method: 'get',
    params: params
  })
}

// 话题 - 审核
export function topicAuth(data) {
  return request({
    url: '/circle/platform/operation/topic/auth',
    method: 'post',
    data: data
  })
}

// 话题 - 审核
export function topicDetail(id) {
  return request({
    url: `/circle/platform/operation/topic/detail${id}`,
    method: 'get',
    params: {}
  })
}

// =======================焦点话题=======================

// 焦点话题 - 列表
export function focusTopicList(params) {
  return request({
    url: '/circle/platform/operation/topic-focus',
    method: 'get',
    params: params
  })
}

// 焦点话题 - 上、下架
export function focusTopicFrame(data) {
  return request({
    url: '/circle/platform/operation/topic-focus/frame',
    method: 'put',
    data: data
  })
}

// 焦点话题 - 新增和编辑
export function focusTopicEdit(data, config) {
  return request({
    url: '/circle/platform/operation/topic-focus',
    method: 'post',
    data: data,
    ...config
  })
}

// 焦点话题 - 可新增话题列表
export function focusTopicUse(params) {
  return request({
    url: '/circle/platform/operation/topic-focus/use',
    method: 'get',
    params: params
  })
}

// 焦点话题 - 详情
export function focusTopicDetail(id) {
  return request({
    url: `/circle/platform/operation/topic-focus/${id}`,
    method: 'get',
    params: {}
  })
}

// 话题关闭
export function closeTopic(topicId) {
  return request({
    url: `/circle/platform/operation/topic/down`,
    method: 'get',
    params: { topicId }
  })
}

// 话题管理
export function topicManage(data) {
  return request({
    url: '/circle/platform/operation/topic/manage',
    method: 'post',
    data: data
  })
}

